home *** CD-ROM | disk | FTP | other *** search
-
- MODULE Banner;
-
- (* Banner.Mod
- 04/11/1986
- John Tal
-
- Version of Banner.Mod - Prints Horizontal banners.
-
- Accesses Character Data in ROM at 0F000H:0FA6EH;
-
- Character Height & Width's are Adjustable
- *)
-
-
-
-
- FROM Printer IMPORT OpenPrinter,ClosePrinter,PrintString,PrintLn;
- FROM InOut IMPORT OpenInput,CloseInput,ReadCard,Done,Write,
- WriteCard,WriteLn,WriteString,ReadString;
- FROM SYSTEM IMPORT ADDRESS,GETREG,AX,SWI,BYTE;
- FROM Strings IMPORT Concat,Length;
-
-
- CONST
- wide = 132;
-
- TYPE
- mainc = ARRAY[1..8] OF ARRAY[1..wide] OF CHAR;
- STRING = ARRAY[0..255] OF CHAR;
-
- VAR
- bytes : POINTER TO ARRAY[0..255] OF ARRAY[1..8] OF CHAR;
- chars : mainc;
- r,c : CARDINAL;
- outstr : STRING;
- cval,byte,a,msgl,sp1,i,height,width : CARDINAL;
-
-
- PROCEDURE Ptr(seg, off : CARDINAL) : ADDRESS;
- VAR
- Result :
- RECORD
- CASE BOOLEAN OF
- FALSE :
- adr : ADDRESS;
- | TRUE :
- off, seg : CARDINAL;
- END;
- END;
- BEGIN
- Result.off := off;
- Result.seg := seg;
- RETURN Result.adr;
- END Ptr;
-
-
- PROCEDURE power(x,n : CARDINAL) : CARDINAL;
- BEGIN
- IF n=1 THEN
- RETURN x;
- ELSIF n <= 0 THEN
- RETURN 1;
- ELSE
- RETURN (x * power(x,n-1));
- END;
- END power;
-
-
- PROCEDURE BitOut ( offs,height,width : CARDINAL);
- VAR
- showLine : STRING;
- left,up,h,bite,w : CARDINAL;
- pattern : BITSET;
- BEGIN
- FOR left := 1 TO 8 DO
- showLine[0] := CHR(0);
- FOR up := 8 TO 1 BY -1 DO
- pattern := BITSET(ORD(bytes^[offs,up])) * BITSET(power(2,8-left));
- bite := CARDINAL(pattern);
- IF bite = 0 THEN
- Write(' ');
- FOR h := 1 TO height DO
- Concat(showLine,' ',showLine);
- END;
- ELSE
- Write('X');
- FOR h := 1 TO height DO
- Concat(showLine,'X',showLine);
- END;
- END;
- END;
- FOR w := 1 TO width DO
- PrintString(showLine); PrintLn;
- END;
- WriteLn;
- END;
- END BitOut;
-
- BEGIN
- bytes := Ptr(0F000H,0FA6EH);
- height := 14; (* 14 *)
- width := 4; (* 3 *)
- WriteString('Banner> ');
- ReadString(outstr);
- WriteLn;
- OpenPrinter;
- FOR a := 0 TO Length(outstr)-1 DO
- Write(outstr[a]); WriteLn;
- i := ORD(outstr[a]);
- BitOut(i,height,width);
- END;
- ClosePrinter;
- END Banner.